/**
 *
 * @param station
 * @param timeType
 * @param startTime
 * @param endTime
 * @returns {*}
 * @constructor
 */
function GetStationList (station, timeType, startTime, endTime) {
    return window.StationController.getStationList(station, timeType, startTime, endTime);
}

/**
 * 根据条码检索数据
 * @param PackNumber
 * @returns {*}
 * @constructor
 */
function GetStationListByPackNumber (PackNumber) {
    return window.StationController.getStationListByPackNumber(PackNumber);
}

function GetStationFirstImage() {
    return window.StationController.getStationFirstImage();
}

/**
 * 下载图片
 * @param filePath
 * @returns {*}
 */
function downImage(filePath) {
    return window.StationController.downImage(filePath);
}

/**
 * 查询生产数据
 * @param startTime
 * @param endTime
 * @param packNumber
 * @param page
 * @param size
 * @constructor
 */
function SearchPackApi (startTime, endTime, packNumber, page, size) {
    return window.PackApi.search(startTime, endTime, packNumber, page, size);
}

/**
 * 补拧结束后，所有数据上传MES
 * @param packNumber
 * @constructor
 */
function toMesApi (packNumber) {
    return window.ProductionApi.toMes(packNumber);
}

/**
 * 上传上盖数据到MES
 * @param packNumber
 * @constructor
 */
function UpperToMesApi (packNumber) {
    return window.ProductionApi.upperToMes(packNumber);
}

/**
 * 上传前面板数据到MES
 * @param packNumber
 * @constructor
 */
function FrontToMesApi (packNumber) {
    return window.ProductionApi.frontToMes(packNumber);
}

/**
 * 过站
 * @param packNumber
 * @constructor
 */
function PassStationsApi (packNumber) {
    return window.ProductionApi.passStations(packNumber);
}

/**
 * 获取这个条码下的所有拧紧数据
 * @param packNumber
 * @constructor
 */
function GetDetailByPackNumberApi (packNumber) {
    return window.ProductionApi.getDetailByPackNumber(packNumber);
}

function GetPackDetailApi (PackNumber) {
    return window.ProductionApi.getPackDetail(PackNumber);
}

function getCurrentDayPackListApi () {
    return window.PackApi.getCurrentDayPackList();
}

/**
 * 修改pack箱状态
 * @param PackNumber
 * @param IsUploadMes  数据是否上传MES   0 = 正在拧，1 = 未上传，2 = 已上传，3 = 手动跳过
 * @returns {*}
 */
function isUploadMesApi (PackNumber, IsUploadMes) {
    return window.PackApi.isUploadMes(PackNumber, IsUploadMes);
}

/**
 *
 * 获取箱子详情数据
 * @param PackNumber
 * @returns {*}
 * @constructor
 */
function GetPackInfoApi (PackNumber) {
    return window.PackApi.getPackInfo(PackNumber);
}

/**
 * 通过箱体码状态，监听设备是否在工作中，如果在工作中则直接开启运行状态
 * @returns {*}
 * @constructor
 */
function OnDeriveWorkingApi () {
    return window.PackApi.onDeriveWorking();
}

/**
 * 检查未完成补拧作业的箱子
 * @returns {*}
 * @constructor
 */
function GetUnfinishedJopPackApi () {
    return window.PackApi.getUnfinishedJopPack();
}

function AddUploadMesDataApi (currentBolt) {
    currentBolt.Id = 0;
    currentBolt.NjVal = currentBolt.T;
    currentBolt.JdVal = currentBolt.A;
    currentBolt.Status = currentBolt.R;
    return window.ProductionApi.addUploadMesData(JSON.stringify(currentBolt));
}

function GetDataStatisticsApi () {
    return window.ProductionApi.getDataStatistics();
}

